package edu.ctbu.datajpa1.controller;

import edu.ctbu.datajpa1.domain.Student;
import edu.ctbu.datajpa1.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Controller
@RequestMapping("/student")
public class StudentController {

  @Autowired
    private StudentService studentService;



    @GetMapping("/{id}")
    public Student findById(@PathVariable  Integer id){

      return studentService.getById(id);



    }
}
